$(document).on('pagechange', function() {
	var easterEgg = false;
    console.log(document.URL);
	if (document.URL.indexOf("index.html") >= 0) {
        $("#hidden-1").show();
        $("#hidden-2").show();
	}
	else{
		$("#hidden-1").hide();
		$("#hidden-2").hide();
	}
});

window.onload = function() {	
	window.addEventListener('shake', shakeEventDidOccur, false);
	function shakeEventDidOccur () {
        changeLogo(1);
	}
};

function hiddenclick1() {
	easterEgg = true;
	setTimeout(function() {easterEgg = false;},2000);
}
function hiddenclick2() {
	if (easterEgg == true) {
		showEasterEgg();
	}
}
function showEasterEgg() {
	$("#background").css("background-image", "url('./img/hidden-"+Math.floor((Math.random()*2)+1)+".png')");
    $("#homelogo").css("display", "none");
	setTimeout(function() {
               $("#background").css("background-image", "url('./img/background.png')");
               $("#homelogo").css("display", "inherit");
    }, 2000);
}
function changeLogo(selectedLogoNum) {
    var logoNum = selectedLogoNum;
    document.getElementById("vermogen").src="img/logo/logo-"+logoNum+".png";
    goToPage('index.html');
}